package com.kaifamiao.thread.d0928.pm;

import java.net.ServerSocket;
import java.net.Socket;

public class TCPServer {

    public static void main(String[] args) throws Exception{
        ServerSocket server = new ServerSocket(8888);

        Socket conn = server.accept();

        System.out.println("建立连接了");

        byte[] bytes = conn.getInputStream().readAllBytes();

        System.out.println("收到了信息：" + new String(bytes));

        conn.getOutputStream().write("不可能".getBytes());

        conn.shutdownOutput();

    }
}
